﻿<Controls:SinacorWindow    
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
    xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
    xmlns:Edit="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Edit;assembly=Sinacor.Infra.UI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d"
	AutoContentWidth="False"
    AutoContentHeight="True"
    WindowStartupLocation="CenterScreen"
    WindowState="Normal" 
    Width="700"
    Height="750"
    Title="{DynamicResource Bovespa.Contabil.Label.CadastroEventosContabeis}" 
    x:Class="Sinacor.UI.Bovespa.Contabil.View.SmartClient.CadastroEventoContabil"
    ModulePlus="False"
    ModuleId="BOL" >

    <Controls:SinacorExpanderContainer x:Name="ExpanderContainer">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Controls:SinacorExpander Header="{DynamicResource Bovespa.Contabil.Label.EventosContabeis}" 
                                  Grid.Row="0"
                                  x:Name="expanderTaxas" IsExpanded="True" AllowExpand="False">

            <Grid>

                <!-- DataGrid Eventos Contabeis -->
                <Controls:SinacorDataGrid x:Name="dataEventos"                                      
                                          AllowDelete="True"
                                          ItemsSource="{Binding ListaEventoContabil}"
                                          Deleting="dataEventos_Deleting" 
                                          BeingInserted="dataEventos_BeingInserted"                                          
                                          BeingUpdated="dataEventos_BeingUpdated"
                                          EndingInsert="dataEventos_EndingInsert"
                                          EndingUpdate="dataEventos_EndingUpdate"
                                          CancelingInsert="dataEventos_CancelingInsert"
                                          CancelingUpdate="dataEventos_CancelingUpdate">
                    <Controls:SinacorDataGrid.Columns>
                        <!-- Coluna Codigo -->
                        <Controls:Column Name="CD_EVECON"
                                         x:Name="colCD_EVECON"
                                         Title="Bovespa.Contabil.Label.PesquisaHistCCCodigo"
                                         HorizontalCellAlignment="Right"                                      
                                         AllowInsert="True"	
                                         AllowUpdate="False"
                                         DisplayMemberPath="Codigo"
										 AutoAdjustWidthToContent="False"
										 Width="70"                                         
                                         Integers="3" 
                                         Decimals="0">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorInt32TextBox 
                                        x:Name="txtCodigo" 
                                        Value="{Binding Codigo}"
                                        Integers="3"                                                                              
                                        ToolTip="{DynamicResource Bovespa.Contabil.Tooltip.InformeCodigoEventoContabil}">
                                        <Controls:SinacorInt32TextBox.ValidationRules>
                                            <Validation:EventValidationRule Validating="EventValidationRule_Validating_txtCodigo" />
                                        </Controls:SinacorInt32TextBox.ValidationRules>
                                    </Controls:SinacorInt32TextBox>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <!-- Coluna Codigo -->

                        <!-- Coluna Descricao -->
                        <Controls:Column Name="DS_EVECON" 	
                                         x:Name="colDS_EVECON"
                                         Title="Bovespa.Contabil.Label.PesquisaDescricao"
                                         HorizontalCellAlignment="Left"                                      
                                         AllowInsert="True"	
                                         AllowUpdate="True"
										 AutoAdjustWidthToContent="False"
										 Width="250"
                                         DisplayMemberPath="Descricao"                                          
                                         MaxLength="30" >
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorTextBox 
                                        x:Name="txtDescricao" 
                                        Text="{Binding Descricao}"
                                        MaxLength="30"                                                                                                                   
                                        ToolTip="{DynamicResource Bovespa.Contabil.Tooltip.InformeDescricaoEventoContabil}">
                                        <Controls:SinacorTextBox.ValidationRules>
                                            <Validation:EventValidationRule Validating="EventValidationRule_Validating_txtDescricao" />
                                        </Controls:SinacorTextBox.ValidationRules>
                                    </Controls:SinacorTextBox>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>

                        </Controls:Column>
                        <!-- Coluna Descricao -->

                        <!-- Coluna Utiliza Municipio -->
                        <Controls:Column Name="IN_MUNICIPIO" 			
                                         Title="Bovespa.Contabil.Label.UtilizaMunicipio"
                                         HorizontalCellAlignment="Center"                                    
                                         AllowInsert="False"
                                         AllowUpdate="False"                                     
                                         DisplayMemberPath="UtilizaMunicipio"
										 AutoAdjustWidthToContent="False"
										 Width="155"
										 >
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorCheckBox  x:Name="chkUtilizaMunicipio" 
                                                               IsChecked="{Binding UtilizaMunicipio}" 
                                                               ToolTip="{DynamicResource Bovespa.Contabil.Tooltip.IndicaUtilizaMunicipio}" />
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <!-- Coluna Utiliza Municipio -->

                    </Controls:SinacorDataGrid.Columns>

                </Controls:SinacorDataGrid>
                <!-- DataGrid Eventos Contabeis -->

            </Grid>

        </Controls:SinacorExpander>
    </Controls:SinacorExpanderContainer>

</Controls:SinacorWindow>
